// 该文件专门用于创建应用的路由器
import VueRouter from 'vue-router'
// 引入组件
import About from '../pages/About.vue'
import Home from '../pages/Home.vue'
import News from '../pages/News.vue'
import Message from '../pages/Message.vue'
import Detail from '../pages/Detail.vue'

// 创建并向外暴露路由器
export default new VueRouter({
    routes: [
        {
            path:'/about',
            component:About,
        },
        {
            path:'/home',
            component:Home,
            // 通过children配置子级路由
            children:[
               {
                    
                    path:'news', //此处一定不要写：/news
                    component:News
               },
               {
                    path:'message', //此处一定不要写：/message
                    component:Message,
                    children:[
                        {
                            path:'detail',
                            component:Detail
                        }
                    ]
               },

            ]
        }
    ]
})